package com.pangda.pojo.vo;

import com.pangda.common.constant.HttpStatusConstant;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class MenuTreeVo {
    private Integer code;
    private List<Integer> checkedKeys;
    private List<NodeVo> menus;
    private String msg;

    public static MenuTreeVo success(String msg, List<NodeVo> data, List<Integer> checkedKeys) {
        return new MenuTreeVo(HttpStatusConstant.SUCCESS, checkedKeys, data, msg);
    }

    public static MenuTreeVo error(Integer code, String msg) {
        return new MenuTreeVo(code, null, null, msg);
    }
}
